#ifndef TL_ANIMATION_PLAYER_VIEW_H
#define TL_ANIMATION_PLAYER_VIEW_H

namespace tl
{
class animation_player_view
{
public:
   animation_player_view (std::tr1::shared_ptr<animation_player> spPlayer, mgresource resource) :
         m_spPlayer (spPlayer),
         m_resource (resource),
         m_dialog (NULL)
      {
      }

      void InitializeDialog (mggui dialog)
      {
         assert(!m_dialog);

         if (!m_dialog)
            m_dialog = dialog;
      }

      mgresource GetResource (void) const
      {
         return m_resource;
      }

      mggui GetDialog (void) const
      {
         return m_dialog;
      }

      animation_player& GetAnimationPlayer (void) const
      {
         assert(m_spPlayer);
         return *m_spPlayer;
      }

      void RefreshDialog (void)
      {
         mgRefreshDialog (m_dialog);
      }

      void RegisterCreateDialog (mgplugintool pluginTool) const;
private:
   mgresource m_resource;
   mggui m_dialog;
   std::tr1::shared_ptr<animation_player> m_spPlayer;
};
} // end namespace tl

#endif